///////////////////////////////////////////////////////////////
// Copyright(c) ephiroth
// 
// FileName : formula_2power.c
// Creator  : ephiroth
// E-Mail   : ephiroth@gmail.com
// Date     : 2009-04-03
// Comment  : 
//
///////////////////////////////////////////////////////////////
#include "comm.h"
#include <math.h>

static  int func_2power ( int index , U8 * data)
{
	int a , b, c, d;
	a = trim_char (data[1],1,3);
	b = trim_char (data[2],2,3);
	c = trim_char (data[3],1,7);
	d = trim_char (data[4],1,7);
	return powl ((c + index), a) + powl ((d+index ),b);
}

static void help_2power (U8 * data)
{
	int a , b, c, d;
	a = trim_char (data[1],1,3);
	b = trim_char (data[2],2,3);
	c = trim_char (data[3],1,7);
	d = trim_char (data[4],1,7);
	printf("[两个数的幂之和]:powl((%d+index),%d) + powl ((%d+index),%d)\n"
			,c,a,d,b);
}

formula formula_2power = {
	"two power ",
	ft_normal ,
	6,
	func_2power,
	help_2power,

};	
